package com.slz3.business.module.socialManagement.socArticle.steward;

import com.slz3.business.module.socialManagement.socArticle.domain.SocArticle;
import com.slz3.business.module.socialManagement.socArticle.domain.SocArticleCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Component
public class SocArticleResponse {

    @Resource
    private SocArticleResController socArticleResController;

    public  Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(SocArticle.class).flatMap(socArticle ->
                socArticleResController.add(req, socArticle)
        );
    }

    public  Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(SocArticleCondition.class).flatMap(socArticleCondition ->
                socArticleResController.delete(req, socArticleCondition)
        );
    }

    public  Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(SocArticle.class).flatMap(socArticle ->
                socArticleResController.modify(req, socArticle)
        );
    }


    public  Mono<ServerResponse> list(ServerRequest req) {
        return socArticleResController.list(req);
    }

    public  Mono<ServerResponse> info(ServerRequest req) {
        return socArticleResController.info(req);
    }

    public  Mono<ServerResponse> choice(ServerRequest req) {
        return socArticleResController.choice(req);
    }

    public  Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(SocArticleCondition.class).flatMap(socArticleCondition ->
                socArticleResController.auditSubmit(req, socArticleCondition)
        );
    }

    public  Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(SocArticleCondition.class).flatMap(socArticleCondition ->
                socArticleResController.audit(req, socArticleCondition)
        );
    }

    public  Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(SocArticleCondition.class).flatMap(socArticleCondition ->
                socArticleResController.auditReject(req, socArticleCondition)
        );
    }

    public  Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(SocArticleCondition.class).flatMap(socArticleCondition ->
                socArticleResController.usingEnable(req, socArticleCondition)
        );
    }

    public  Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(SocArticleCondition.class).flatMap(socArticleCondition ->
                socArticleResController.usingDisable(req, socArticleCondition)
        );
    }   

}
